package org.example.shop.ware.service.impl;

import org.example.shop.entity.Ware;
import org.example.shop.ware.dao.WareDao;
import org.example.shop.ware.service.WareService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class WareServiceImpl implements WareService {
    @Resource
    private WareDao wareDao;

    public Ware findByWid(Integer wid) {
        return wareDao.findById(wid).get();
    }

    @Override
    public Ware save(Ware ware) {
        return wareDao.saveAndFlush(ware);
    }
}
